home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / ifunc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.6 KB  |  68 lines

  1. /* Copyright (C) 1997, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: ifunc.h,v 1.3 2000/09/19 19:00:43 lpd Exp $ */
  20. /* Internal interpreter interfaces for Functions */
  21.  
  22. #ifndef ifunc_INCLUDED
  23. #  define ifunc_INCLUDED
  24.  
  25. #include "gsfunc.h"
  26.  
  27. /* Define build procedures for the various function types. */
  28. #define build_function_proc(proc)\
  29.   int proc(P5(const ref *op, const gs_function_params_t *params, int depth,\
  30.           gs_function_t **ppfn, gs_memory_t *mem))
  31. typedef build_function_proc((*build_function_proc_t));
  32.  
  33. /* Define the table of build procedures, indexed by FunctionType. */
  34. typedef struct build_function_type_s {
  35.     int type;
  36.     build_function_proc_t proc;
  37. } build_function_type_t;
  38. extern const build_function_type_t build_function_type_table[];
  39. extern const uint build_function_type_table_count;
  40.  
  41. /* Build a function structure from a PostScript dictionary. */
  42. int fn_build_function(P3(const ref * op, gs_function_t ** ppfn,
  43.              gs_memory_t *mem));
  44. int fn_build_sub_function(P4(const ref * op, gs_function_t ** ppfn,
  45.                  int depth, gs_memory_t *mem));
  46.  
  47. /* Allocate an array of function objects. */
  48. int alloc_function_array(P3(uint count, gs_function_t *** pFunctions,
  49.                 gs_memory_t *mem));
  50.  
  51. /*
  52.  * Collect a heap-allocated array of floats.  If the key is missing, set
  53.  * *pparray = 0 and return 0; otherwise set *pparray and return the number
  54.  * of elements.  Note that 0-length arrays are acceptable, so if the value
  55.  * returned is 0, the caller must check whether *pparray == 0.
  56.  */
  57. int fn_build_float_array(P6(const ref * op, const char *kstr, bool required,
  58.                 bool even, const float **pparray,
  59.                 gs_memory_t *mem));
  60.  
  61. /*
  62.  * If a PostScript object is a Function procedure, return the function
  63.  * object, otherwise return 0.
  64.  */
  65. gs_function_t *ref_function(P1(const ref *op));
  66.  
  67. #endif /* ifunc_INCLUDED */
  68.